package com.headingdata.demo;

import java.util.Random;
import java.util.Scanner;

public class Test3 {

    public static void main(String[] args) {
        //输入工号随机排名
        int[] staffs = new int[6];
        Scanner scan = new Scanner(System.in);

        for (int i = 0;i < staffs.length;i++){
            System.out.println("请输入第" + (i+1) + "位员工工号：");
            int num = scan.nextInt();
            staffs[i] = num;
        }
        Random r = new Random();
        for(int i = 0;i < staffs.length;i++){
            int rn = r.nextInt(staffs.length);
            int temp = staffs[i];
            staffs[i] = staffs[rn];
            staffs[rn] = temp;
        }

        for (int staff : staffs) {
            System.out.print(staff + " ");
        }

    }
}
